<?php

include_once 'Statement.php';
include_once 'Comment.php';

class CommentStatement extends Statement
{
    function __construct(Comment $comment = null)
    {
        is_null($comment) ?
            $this->Comment = new Comment() :
            $this->set_comment($comment);
    }

    public function __set($name, $value)
    {
        parent::__set($name, $value);
        
        if($name == 'Comment')
        {
            $this->set_comment($value);
        }
    }
    
    public function __get($name)
    {
        $ret = parent::__get($name);
        
        if($ret != null)
        {
            return $ret;
        }
        
        if ($name == 'Comment')
        {
            return $this->get_comment();
        }
    }
    
    public function get_comment()
    {
        return $this->Comment;
    }

    public function set_comment(Comment $comment)
    {
        $this->Comment = $comment;
    }

        private $Comment;
}

?>
